# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=gwaterfall
pkgver=0.1
_debpatch=5.1
pkgrel=1
pkgdesc="View all characters of a font in all sizes"
arch=('i686' 'x86_64')
url="https://launchpad.net/ubuntu/+source/gwaterfall"
license=('custom')
depends=('gtk2')
makedepends=()
source=(http://http.debian.net/debian/pool/main/g/${pkgname}/${pkgname}_${pkgver}.orig.tar.gz
        http://http.debian.net/debian/pool/main/g/${pkgname}/${pkgname}_${pkgver}-${_debpatch}.diff.gz)
md5sums=('8fb9008077b96db7a06ab016450568cb'
         'c5c7165f39dcb298637b8cd8a66f3d5a')

prepare() {
	cd ${pkgname}
	patch -p1 -i "$srcdir/${pkgname}_${pkgver}-${_debpatch}.diff"

	aclocal #--verbose
	libtoolize #--verbose
	autoconf -f #-v
    touch NEWS README ChangeLog
	automake  --add-missing #--verbose
	chmod +x ./configure
}

build() {
	cd ${pkgname}
	./configure --prefix=/usr
	make
}

package() {
	cd ${pkgname}
	make DESTDIR="$pkgdir/" install
	
	# menu
	install -m755 -d ${pkgdir}/usr/share/applications
	install -Dm644 ${srcdir}/${pkgname}/debian/$pkgname.desktop ${pkgdir}/usr/share/applications
	# manpage
	install -m755 -d ${pkgdir}/usr/share/man/man1
	install -Dm644 ${srcdir}/${pkgname}/debian/waterfall.1 ${pkgdir}/usr/share/man/man1
	
	# license
	install -m755 -d ${pkgdir}/usr/share/licenses/$pkgname
	install -Dm644 ${srcdir}/${pkgname}/COPYING ${pkgdir}/usr/share/licenses/$pkgname
}
